﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sealight.Core.DataAdapter;
namespace Sealight.Core.Domain
{
  public  class TopicEntity
    {
      public virtual Guid TopicID { get; set; }
      public virtual string Name { get; set; }

      public virtual IList<TopicLocalizedEntity> TopicLocalized { get; set; }

      public virtual topic ToDataAdapter()
      {
          topic entity = new topic
          {
              id = this.TopicID,
              name = this.Name
          };

          if(this.TopicLocalized!= null)
          {
              IList<topic_localized> topic_local=new List<topic_localized>();
              foreach(TopicLocalizedEntity data in this.TopicLocalized)
              {
                  topic_local.Add(data.ToDataAdapter());
              }

              entity.topic_localized = topic_local;
          }

          return entity;
      }
    }
}
